let num2: any = 123;
num2 = "str";
let num3: number | string | null | undefined = 123;
num3 = "asd";

//======================
/*
    null和undefined是其它类型的子类型
*/

// let num4: number;
// console.log(num4);
let num4: undefined;
console.log(num4);

//void没有任何类型 方法没有返回值
function run() {
  console.log(123);
}
run();

function run2(): void {
  console.log(123);
}
run2();
function run3(): number {
  return 123;
}
run3();
//never(null,和undefined)
let ab: undefined;
ab = undefine;

let ba: null;
ba = null;

let er: never = (() => {
  throw new Error("错误永远不会出现");
})();
